import {ajax,defaultBefore,silentAfter} from "@/utils/ajax.js"


export const getByKey =(key)=>{
	return ajax({
		url:'/sysConfig/getByKey',
		method:'GET',
		data:{
			key
		}
	})
}

export const getBatchConfig =(key)=>{
	return ajax({
		url:'/sysConfig/list',
		data:{}
	})
}


export const getDict =(type)=>{
	return ajax({
		url:'/sysDictData/getByType',
		method:'GET',
		data:{
			type
		}
	})
}


export const latestVersion = ({version,type})=>{
	console.log("platform",type)
	return ajax({
		url:'/appUpdate/news',
		data:{
			type,
			version
		},
		defaultBefore,
		silentAfter
	})
}
export default {
	getByKey,
	getBatchConfig,
	getDict,
	latestVersion
}